


*Change the directory to the location of the replication files on your computer
cd "C:\PCult_Replication"

*we downloaded the 2016 ANES data here: https://electionstudies.org/data-center/
*ANES policy is: "Can I disseminate datasets that I have created using ANES data? Yes, ANES public release datasets are public goods. We ask that users provide a link back to the original ANES dataset from which your own variables were derived. ANES restricted-use datasets, and derivatives thereof (including replication datasets), may not be disseminated further, in order to protect respondent confidentiality."
*We are very grateful for access to ANES and the ability to post for our replication package

*We used the code below to create our Study 2 data file "anes_vars_2016.dta" from the full ANES public data. 

use "anes_timeseries_2016.dta", clear

svyset [pweight=V160102], strata(V160201) psu(V160202)

****Demographics and controls

*V161267x PRE: SUMMARY - Respondent age group

tab V161267x 

gen Over44 = 0
replace Over44 = 1 if V161267x >=7 & V161267x <=13
replace Over44=. if V161267x <1

label var Over44 "45 or Older"

tab V161267x  Over44

*V161310x PRE: SUMMARY - R self-identified race

tab V161310x

gen White = 0
replace White = 1 if V161310x==1
replace White = . if V161310x<1

tab V161310x White

*V161002 PRE: FTF ONLY: INTERVIEWER : Is R male or female (Observation)
*V165723 Label: WEB SCREENER: S7. Gender

tab V161002
tab V165723

gen Female = 0
replace Female = 1 if V161002==2 | V165723==2

tab V161002 V165723

bysort Female: tab V161002 V165723

gen Male = 0
replace Male = 1 if V161002==1 | V165723==1


*High School or less
*V161270 Label: PRE: Highest level of Education
*V168256 Label: PRE IWR DESCR: FTF ONLY: education group
*V168306 Label: POST IWR DESCR: FTF ONLY: education group

tab V161270

gen HighSchoolLess = 0
replace HighSchoolLess=1 if (V161270>0 & V161270<10) | V161270==90

label var HighSchoolLess "High School or Less"

tab V161270 HighSchoolLess

*Religious
/*
327 V161241 PRE: Is religion important part of R life
328 V161242 PRE: Religion provides guidance in day-to-day living
329 V161243 PRE: Is Bible word of God or men
330 V161244 PRE: Ever attend church or religious services
331 V161245 PRE: Attend religious services how often
332 V161245a PRE: Attend church more often than once a week
333 V161246 PRE: Ever think of self as part of church or denomination
*/

tab V161244
tab V161241
tab V161245

gen Religious = 0
replace Religious = 1 if V161241==1

tab V161241 Religious

tab Religious  V161245

gen Church = (5-V161245)/4 if V161244>0 & V161245~=-9
replace Church =0 if V161244==2 & V161245~=-9

tab Church V161244
tab Church V161245


*****V161155 Party ID

tab V161155

gen Democrat=0 if V161155>=0
replace Democrat=1 if V161155==1

gen Republican=0 if V161155>=0
replace Republican=1 if V161155==2

gen Independent=0 if V161155>=0
replace Independent=1 if V161155==3

*V161156

tab V161156

tab V161156 V161155

gen Strong_Rep = 0 if V161156>0
replace Strong_Rep = 1 if V161156==1 & V161155==2

gen Strong_Dem = 0 if V161156>0
replace Strong_Dem = 1 if V161156==1 & V161155==1

*V161019 PRE: Party of registration
*V162022 POST: R registered to vote (Post-election)
*V162030 POST: Party of registration

tab V161019
tab V162030
tab V162022

gen RegRep_PRE = 0
replace RegRep = 1 if V161019==2
label var RegRep "Registered Republican"

gen RegRep = 0
replace RegRep = 1 if V161019==2 | V162030==2
label var RegRep "Registered Republican"

gen RegDem = 0
replace RegDem = 1 if V161019==1 | V162030==1
label var RegDem "Registered Democrat"

gen Indep = 0
replace Indep = 1 if V161019==4| V162030==4
label var Indep "Independent"

*V161021a PRE: For which candidate did R vote in Presidential prim

tab V161021a 

gen TrumpPrimary = 0
replace TrumpPrimary = 1 if V161021a ==4
label var TrumpPrimary "Voted for Trump in Primary"


/*
V161027 PRE: For whom did R vote for President
V161028 PRE: Preference strong for Pres cand for whom R voted
V161030 PRE: Does R intend to vote for President
V161031 PRE: For whom does R intend to vote for President
V161032 PRE: Pref strng for Pres cand for whom R intends to vote
*/

tab V161027
tab V161028
tab V161031
tab V161032

*V161020 PRE: Does R intend to register to vote

tab V161020

*V161034 PRE: Preference for Pres cand (no intent to register)
*V161035 PRE: Preference strong for Pres cand (no intent to reg)	

tab V161034
tab V161035

/*
V162034a POST: For whom did R vote for President
V162035 POST: Preference strong for Pres cand for whom R voted
*/

tab V162034a
tab V162035

*V162038x POST: SUMMARY- Preference for Pres cand (did not vote)

tab V162038x

**exclude those who did not vote or did not intend to register / vote


gen StrongTrump = 0
replace StrongTrump = 1 if (V161027 ==2 & V161028==1) | (V161031==2 & V161032==1) |  (V162034a==2 & V162035==1)

tab StrongTrump

*V162062x 2016 PRE-POST VOTE SUMMARY: 2016 Presidential vote
*V162063x 2016 PRE-POST VOTE SUMMARY: 2016 Pre intent vote for Pres - Post vote for Pres

tab V162062x
tab V162063x

gen TrumpVoter = 0
replace TrumpVoter = 1 if V162063x==11 | V162063x==21

tab TrumpVoter

tab TrumpVoter StrongTrump


/*
107 V161074 PRE: Is there anything R likes about Republican Pres cand
108 V161075 PRE: Text- What is it that R likes about Republican Pres cand
109 V161076a PRE: Code- What is it that R likes about Republican Pres cand
110 V161077 PRE: Is there anything R dislikes about Republican Pres cand
111 V161078 PRE: Text- What is it that R dislikes about Republican Pres cand
112 V161079a PRE: Code- What is it that R dislikes about Republican Pres cand
*/

tab V161074
tab V161075
tab V161076a
tab V161077

gen TrumpNoDislike = 0
replace TrumpNoDislike = 1 if V161077==2

tab TrumpNoDislike

tab TrumpNoDislike StrongTrump


*V161087 PRE: Feeling Thermometer: Republican Presidential cand
*V162079 POST: Feeling thermometer: Republican Presidential candidate

tab V161087
tab V162079


***90

gen TrumpHot90_PRE=0
replace TrumpHot90_PRE=1 if (V161087>=90 & V161087<=100)



/*
V161121 PRE: Affect for Republican Pres cand: angry
V161122 PRE: Affect for Republican Pres cand: hopeful
V161123 PRE: Affect for Republican Pres cand: afraid
V161124 PRE: Affect for Republican Pres cand: proud
V161125 PRE: Affect for Republican Pres cand: disgusted
*/

tab V161122
tab V161124

gen TrumpHope = 0
replace TrumpHope=1 if V161122>=4

gen TrumpProud = 0
replace TrumpProud=1 if V161124>=4

tab V161122 TrumpHope
tab V161124 TrumpProud


*V161126 PRE: 7pt scale Liberal conservative self-placement
**Don't use post-election values unless no pre-election values, since might be influenced by vote choice / election outcome
*V162171 POST: 7pt scale liberal-Conservate: self placement

tab V161126
tab V162171
tab V162171 V161126

summarize V162171 V161126

gen ConservativePRE = V161126 if V161126>=1 & V161126<=7

gen ConservativePRE1 = (ConservativePRE-1)/6

summarize ConservativePRE1 ConservativePRE


gen ConservativeDum = 0 if ConservativePRE~=.
replace ConservativeDum = 1 if ConservativePRE>=6 & ConservativePRE<=7

 tab ConservativeDum V161126

*V162289 POST: CSES: 10pt scale: left-right self placement

tab V162289 

gen LeftRight = V162289/10  if V162289 >=0 & V162289 <=10

tab LeftRight V162289 


***authoritarian

*Authoritarianism

/*
919 V162168 POST: Country needs free thinkers
920 V162169 POST: Country would be great by getting rid of rotten apples
921 V162170 POST: Country needs strong leader to take us back to true path
1011 V162239 POST: Child trait more important: independence or respect
1012 V162240 POST: Child trait more important: curiosity or good manners
1013 V162241 POST: Child trait more important: obedience or self-reliance
1014 V162242 POST: Child trait more important: considerate or well-behaved
1037 V162263 POST: Strong leader is good for U.S. even if bends rules to get things done
*/

tab V162168
tab V162169
tab V162170
tab V162239
tab V162240
tab V162241
tab V162242
tab V162263 

gen  NoFreeThinking = 0 if V162168>0
replace NoFreeThinking = 1 if (V162168==4 | V162168==5)

gen RottenApples = 0 if  V162169>0
replace RottenApples = 1 if  V162169==1

gen StrongLeader = 0 if V162170>0 
replace StrongLeader = 1 if V162170==1

gen Respect = 0 if V162239>0
replace Respect = 1 if V162239==2

gen Manners = 0 if V162240>0
replace Manners = 1 if V162240==2

gen Obedience = 0 if V162241>0
replace Obedience = 1 if V162241==1

gen Behaved = 0 if V162242>0
replace Behaved = 1 if V162242==2

gen StrongLeadUS = 0 if V162263>0 
replace StrongLeadUS = 1 if (V162263==1 |  V162263==2 )


gen Authoritarian = (NoFreeThinking + RottenApples + StrongLeader + Respect + Manners + Obedience + Behaved + StrongLeadUS)/8

***Traditionalism
/*
969 V162207 POST: Agree/disagree: world is changing and we should adjust
970 V162208 POST: Agree/disagree: newer lifestyles breaking down society
971 V162209 POST: Agree/disagree: be more tolerant of other moral standards
972 V162210 POST: Agree/disagree: more emphasis on traditional family values

994 V162230 POST: Better if man works and woman takes care of home
995 V162230a POST: How much better if man works and woman at home
996 V162230b POST: How much worse if man works and woman at home
997 V162230x POST: SUMMARY- Better if man works and woman takes care of home
*/

tab V162207
tab V162208
tab V162209 
tab V162210
tab V162230x

gen DontAdjust = 0 if V162207>0
replace DontAdjust = 1 if V162207==5

gen BreakSociety = 0 if V162208>0
replace BreakSociety = 1 if V162208==1

gen NoTolerance = 0 if V162209 >0
replace NoTolerance = 1 if (V162209 ==4 | V162209 ==5)

gen FamilyValues=0 if V162210>0
replace FamilyValues=1 if V162210==1

gen ManWork = 0 if V162230x>0
replace ManWork = 1 if (V162230x==1 | V162230x==2 )

gen Tradition = (DontAdjust + BreakSociety + NoTolerance + FamilyValues + ManWork)/5

summarize DontAdjust BreakSociety NoTolerance FamilyValues ManWork Tradition


***Social Dominance
/*
1015 V162243 POST: Society should make sure everyone has equal opportunity
1016 V162244 POST: We'd be better off if worried less about equality
1017 V162245 POST: Not a big problem if some have more chance in life
1018 V162246 POST: If people were treated more fairly would be fewer probs
1040 V162266 POST: Minorities should adapt to to customs/traditions of U.S.
1041 V162267 POST: The will of the majority should always prevail
*/

tab V162244
tab V162245
tab V162266

gen Inequality = 0 if V162244>0
replace Inequality = 1 if (V162244==1 |V162244==2)

gen MoreChance = 0 if V162245>0
replace MoreChance = 1 if (V162245==1 | V162245==2 )

gen MinoritiesAdapt = 0 if V162266>0
replace MinoritiesAdapt = 1 if V162266==1

gen Dominance = (Inequality + MoreChance + MinoritiesAdapt)/3

/*white identity
1108 V162327 POST: FTF CASI/WEB: How important is being White to identity
1141 V162360 POST: FTF CASI/WEB: Discrimination in the U.S. against Whites
1098 V162317 POST: FTF CASI/WEB: How likely whites unable to find job b/c employers hire minorities
1097 V162316 POST: FTF CASI/WEB: How important whites work together to change laws unfair to whites
*/

tab V162360
tab  V162327
tab V162317 
tab V162316

gen WhiteDiscrim = 6-V162360 if V162360>0

gen WhiteIdentity = 6-V162327 if V162327>0

gen WhiteNoJobs = 6-V162317 if V162317>0

gen WhiteTogether = 6-V162316 if V162316>0

tab WhiteDiscrim 
tab WhiteIdentity 
tab WhiteNoJobs 
tab WhiteTogether

gen WhiteIDindex = (WhiteDiscrim + WhiteIdentity + WhiteNoJobs + WhiteTogether)/4

summarize WhiteDiscrim WhiteIdentity WhiteNoJobs WhiteTogether WhiteIDindex
corr  WhiteDiscrim WhiteIdentity WhiteNoJobs WhiteTogether WhiteIDindex

gen WhiteDiscrim1 = (WhiteDiscrim-1) /4
gen WhiteIDindex1 = (WhiteIDindex-1)/4


summarize WhiteDiscrim1 WhiteIDindex1

*populism?
/*
V162140 POST: Does R favor or oppose tax on millionaires
V162192 POST: Should the minimum wage be raised
V162215 POST: [STD] Publ officials don't care what people think
V162216 POST: [STD] Have no say about what govt does
V162220 POST: Electoral integrity: do the rich buy elections
V162235 POST: How much does Cong pass laws that benefit contributor organizations
V162236 POST: How much does Cong pass laws that benefit contributor individuals
V162260 POST: Most politicians do not care about the people
V162261 POST: Most politicians are trustworty
V162265 POST: Most politicians only care about interests of rich and powerful

*/



tab V162216
tab V162220
tab V162235
tab V162236
tab V162260
tab V162261
tab V162265

gen NoSay = 0 if V162216>0
replace NoSay = 1 if (V162216==1 | V162216==2)

gen BuyElections = 0 if V162220>0
replace BuyElections = 1 if (V162220==1 | V162220==2)

gen LawsForOrgs = 0 if  V162235>0
replace LawsForOrgs = 1 if  (V162235==1 | V162235==2)

gen LawsForInds = 0 if  V162236>0
replace LawsForInds = 1 if  (V162236==1 | V162236==2)

gen PolsDontCare = 0 if V162260>0
replace PolsDontCare = 1 if (V162260==1 | V162260==2 )

gen DontTrustPols = 0 if V162261>0
replace DontTrustPols = 1 if (V162261==4 | V162261==5)

gen PolsCareRich = 0 if V162265>0
replace PolsCareRich = 1 if (V162265==1 | V162265==2)

gen PopulistVoter = (NoSay + BuyElections + LawsForOrgs + LawsForInds + PolsDontCare + DontTrustPols + PolsCareRich)/7


***TIPI

/*
1114 V162333 POST: FTF CASI/WEB: TIPI extraverted, enthusiastic
1115 V162334 POST: FTF CASI/WEB: TIPI critical, quarrelsome
1116 V162335 POST: FTF CASI/WEB: TIPI dependable, self-disciplined
1117 V162336 POST: FTF CASI/WEB: TIPI anxious, easily upset
1118 V162337 POST: FTF CASI/WEB: TIPI open to new experiences
1119 V162338 POST: FTF CASI/WEB: TIPI reserved, quiet
1120 V162339 POST: FTF CASI/WEB: TIPI sympathetic, warm
1121 V162340 POST: FTF CASI/WEB: TIPI disorganized, careless
1122 V162341 POST: FTF CASI/WEB: TIPI calm, emotionally stable
1123 V162342 POST: FTF CASI/WEB: TIPI conventional, uncreative
*/

/*
https://gosling.psy.utexas.edu/scales-weve-developed/ten-item-personality-measure-tipi/ten-item-personality-inventory-tipi/

TIPI scale scoring ("R" denotes reverse-scored items):

Extraversion: 1, 6R; Agreeableness: 2R, 7; Conscientiousness; 3, 8R; Emotional Stability: 4R, 9; Openness to Experiences: 5, 10R.
*/

tab V162333

gen Extraversion = (V162333 +(8-V162338))/2 if V162333>0 & V162338>0
gen Agreeableness = ((8-V162334)+V162339)/2 if V162334>0 & V162339>0
gen Conscientiousness = (V162335 + (8-V162340 ))/2 if V162335>0 & V162340>0
gen Stability = ((8-V162336) + V162341)/2 if V162336>0 & V162341>0
gen Openness = (V162337 + (8-V162342))/2 if V162337>0 & V162342>0

summarize Extraversion-Openness

tab V162335
tab V162340

gen C_SelfDisc1 = (V162335-1)/6 if V162335>0

gen C_Disorg1 = (V162340-1)/6 if V162340>0

tab C_SelfDisc1 V162335
tab C_Disorg1 V162340


****TrumpCult
 ***
 gen TrumpCult90 = 0

replace TrumpCult90 = 1 if TrumpNoDislike==1 & StrongTrump==1 & TrumpHot90_PRE==1 & TrumpVoter==1 & TrumpHope==1

 
 ****standardize
 

 gen Extraversion1 = (Extraversion-1)/6
 gen Agreeableness1 = (Agreeableness-1)/6
 gen Conscientiousness1 = (Conscientiousness-1)/6
 gen Stability1 = (Stability-1)/6
 gen Openness1 = (Openness-1)/6

 
 
 ***Trump Index
 
 
gen TrumpIndex_S2 = (TrumpNoDislike + StrongTrump + ( V161087/100) + TrumpVoter + ((V161122-1)/4))/5 if  V161087>=0 & V161087~=. & V161122>=0 & V161122~=.

****labels

	label var Conscientiousness1  "Conscientiousness"
	label var Extraversion1 "Extraversion"
	label var Agreeableness1 "Agreeableness"
	label var Stability1 "Stability"
	label var Openness1 "Openness"
	label var ConservativePRE1 "Conservative"
	label var  Tradition "Tradition"
	label var Authoritarian "Authoritarian"
	label var Dominance "Dominance"
	label var White "White"
	label var HighSchoolLess "High School or Less"
	label var Over44 "45 or Older"
	label var LeftRight "Left-Right Ideology"
	label var Republican "GOP"

 
 
 
 keep TrumpCult90 TrumpIndex_S2 Agreeableness1 Conscientiousness1 Extraversion1 Stability1 Openness1  ConservativePRE1 Tradition Authoritarian Dominance White Female Republican Over44 HighSchoolLess Church  LeftRight V160102 V160201 V160202 V161021 V161021a 
 
 save "anes_vars_2016.dta", replace
 
 
 
